package org.intellij.plugins.junit4;

/**
 * Configuration for the plugin. Set up by the ConfigurationPanel. Retarded non-OO bean-style
 * crud that's pretty much required by the idea plugin architecture.
 *
 * @author Justin Tomich
 */
@SuppressWarnings({"WeakerAccess"})
public class Configuration
{
    private static final String DEFAULT_PREFIX = "";
    private static final String DEFAULT_SUFFIX = "Test";

    public String prefix; // public for IDEA's JDOM Externalizer
    public String suffix;


    public Configuration()
    {
    }


    public void setDefaultsIfNotConfigured()
    {
        if (isNotConfigured())
        {
            prefix = DEFAULT_PREFIX;
            suffix = DEFAULT_SUFFIX;
        }
    }


    private boolean isNotConfigured()
    {
        return (prefix == null && suffix == null);
    }


    public String getPrefix()
    {
        return prefix;
    }


    public void setPrefix(String prefix)
    {
        this.prefix = prefix;
    }


    public String getSuffix()
    {
        return suffix;
    }


    public void setSuffix(String suffix)
    {
        this.suffix = suffix;
    }


    public String toString()
    {
        return "Configuration{" +
                "prefix='" + prefix + '\'' +
                ", suffix='" + suffix + '\'' +
                '}';
    }
}
